package com.yycx.module.bus.provider.handler.haiying.common;

import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.interceptor.PageInterceptor;
import com.yycx.common.mybatis.model.PageParams;
import com.yycx.common.mybatis.model.ResultBody;
import com.yycx.common.mybatis.query.CriteriaQuery;
import com.yycx.module.bus.client.entity.BusCustomBalance;
import com.yycx.module.bus.client.entity.BusSalemanBalance;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 客户保证金抵扣列表
 *
 * @author zyf
 */
@Component("saleManBalancePageListHandler")
public class SaleManBalancePageListHandler implements PageInterceptor<BusSalemanBalance> {


    @Override
    public ResultBody validate(CriteriaQuery cq, EntityMap params) {
        return ResultBody.ok();
    }

    @Override
    public void prepare(CriteriaQuery cq, PageParams pageParams, EntityMap params) {
        Long saleManId = cq.getLong("saleManId");
        cq.eq(BusSalemanBalance.class, "saleManId", saleManId);
        cq.isNull("orderId");
        cq.eq("balanceState",1);
        cq.eq("optType", 1);
    }

}
